import { $post, $get, $delete, $put } from "@/utils/request";

// 查询所有健康信息
export const $Inquire = async () => {
    let ret = await $post("/health/Inquire")
    return ret
}

// ID查询健康信息
export const $InquireById = async (params: object) => {
    const { id } = params
    let ret = await $post(`/health/InquireId?id=${id}`)
    return ret
}

// 查询对应类别的所有健康信息
export const $Department = async (params: object) => {
    const { classification } = params
    let ret = await $post(`/health/Department?classification=${classification}`)
    return ret
}

// 新增健康信息
export const $InsertHealth = async (params: object) => {
    return await $post('/health/insertHealth', params)
}

// 删除健康信息
export const $DeleteHealth = async (params: object) => {
    const queryParams = params.map(id => `ids=${id}`).join('&');
    return await $delete(`/health/deleteHealth?${queryParams}`)
}

// 修改健康信息
export const $UpdateHealth = async (params: object) => {
    return await $put('/health/updateHealth', params)
}